package com.woniuxy.educationplatform.service.impl;

import com.woniuxy.educationplatform.bean.KnowpointBean;
import com.woniuxy.educationplatform.mapper.KnowpointMapper;
import com.woniuxy.educationplatform.service.IKnowpointService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class KnowpointServiceImpl implements IKnowpointService {

    @Resource
    private KnowpointMapper knowpointMapperImpl;
    @Override
    public KnowpointBean findById(Long id) {
        return knowpointMapperImpl.findById(id);
    }

    @Override
    public List<KnowpointBean> findAll() {
        return knowpointMapperImpl.findAll();
    }

    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public void saveKnowpointBean(KnowpointBean knowpointBean) {
    knowpointMapperImpl.saveKnowpointBean(knowpointBean);
    }

    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public void delete(Long id) {
        knowpointMapperImpl.delete(id);
    }

    @Transactional(isolation = Isolation.REPEATABLE_READ,rollbackFor = Exception.class)
    @Override
    public void update(KnowpointBean knowpointBean) {
        knowpointMapperImpl.update(knowpointBean);
    }

    @Override
    public List<KnowpointBean> findOneByCondition(KnowpointBean knowpointBean) {
        return knowpointMapperImpl.findOneByCondition(knowpointBean);
    }

    @Override
    public String[] getknowpointName() {
        return knowpointMapperImpl.getknowpoint();
    }
}
